/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vue;

import media.Media;
import media.Photo;
import java.util.ArrayList;

/**
 * Classe qui étend TableModele et défini le modele d'une JTable pour les photo
 * @author Florian MININ & Khémon BEH
 */
public class TableModelePhoto extends TableModele {

    public TableModelePhoto() {
        this.nomsColonnes = new String[]{"", "Nom", "Emplacement", "Description", "Date", "Lieu", "Note"};
    }

    public TableModelePhoto(ArrayList<Media> tab) {
        this.nomsColonnes = new String[]{"", "Nom", "Emplacement", "Description", "Date", "Lieu", "Note"};
        donnees = tab;
    }

    public Object getValueAt(int row, int col) {
        Photo photo = (Photo) donnees.get(row);
        if (col == 0) {
            return row + 1;
        }
        if (col == 1) {
            return photo.getNomFichier();
        }
        if (col == 2) {
            return photo.getCheminSurDisque();
        }
        if (col == 3) {
            return photo.getDescription();
        }
        if (col == 4) {
            return photo.getDate();
        }
        if (col == 5) {
            return photo.getLieu();
        } else {
            return photo.getNote();
        }
    }

    public void setNomsColonnes(String[] nomsColonnes) {
        this.nomsColonnes = new String[]{"", "Nom", "Emplacement", "Description", "Date", "Lieu", "Note"};
    }
}
